#ifndef GUIKITROBOT_H
#define GUIKITROBOT_H

#include <QtGui/QMainWindow>
#include <QSize>
#include <qfocusframe.h>
#include "Enums.h"
#include <QGraphicsItem>
#include "GUIBase.h"
#include "Kit.h"
#include "KitRobotGUIInterface.h"
#include "KitRobotAgent.h"
#include <vector>

#define PI 3.14


class Table;

class GUIKitRobot : public GUIBase, public KitRobotGUIInterface
{
	//Q_OBJECT

public:
	GUIKitRobot(int startx, int starty);
	~GUIKitRobot();

	QPointF pivotLoc;
	QPointF armLoc;

	enum GUIKitRobotState {Rotate, PickUpKit, DropOffKit, DoNothing};

	GUIKitRobotState state;
	void DoGoToNeutralPosition();
	void DoGoToDestination(QPoint destination);
	void DoPickUpKit(Kit *k);
	void DoDropOffKit();
	void setAgent(KitRobotAgent* Agent);
	virtual void DoBreak();
	virtual void DoFix();
	void update();

	qreal calculate_angle(QPoint destination);


private:
		int X, Y;
		Kit* kitHeld;
		bool hasKit;
		virtual void advance(int phase);
		virtual void doneRotating();

		KitRobotAgent *agent;
};


#endif // KITROBOT1_H
